package string;
/** String replaceAll(String regex,String s) 替换 */
public class ReplaceAllDemo {
    public static void main(String[] args) {
        String line = "aksd159ad753aksd654";
        //将部分替换为*
        line = line.replaceAll("[2-8]+","*");
        System.out.println(line);

        String s1 = "asd155df54sd45s";
        s1 = s1.replaceAll("[2-8]+","*");
        System.out.println(s1);
    }
}
